<div class="widget-content">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'server-form',
	'enableAjaxValidation'=>false,
	'htmlOptions'=>array('class'=>'form-horizontal', 'novalidate'=>'novalidate'),
)); ?>
	<?php if($form->errorSummary($model)):?>
			<div class="alert alert-block">
				<a class="close" data-dismiss="alert" href="#">&times;</a>
				<h4 class="alert-heading"><?php echo $form->errorSummary($model); ?></h4>
			</div>
	<?php endif;?>
	<fieldset>
	
	<div class="control-group">
		<label class="control-label required" >Select Server</label>
		<div class="controls">
			<?php echo $form->dropDownList($model,'en_name', $server); ?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'name',array('class'=>'control-label','for'=>'name')); ?>
		<div class="controls">
			<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>200,'class'=>'input-large')); ?>
			<?php echo $form->error($model,'name'); ?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'en_name',array('class'=>'control-label','for'=>'en_name')); ?>
		<div class="controls">
			<?php echo $form->textField($model,'en_name',array('size'=>60,'maxlength'=>200,'class'=>'input-large')); ?>
			<?php echo $form->error($model,'en_name'); ?>
			<?php echo $form->hiddenField($model,'fid'); ?>
			<?php echo $form->error($model,'fid'); ?>
		</div>
	</div>
	<div class="control-group">
		<?php echo $form->labelEx($model,'description',array('class'=>'control-label','for'=>'description')); ?>
		<div class="controls">
				<?php 
					$this->widget('application.extensions.KCEditor.KCEditor',array(
						'model'=>$model,				# Data-Model (form model)
						'attribute'=>'description',			# Attribute in the Data-Model
						'height'=>'400px',
						'width'=>'100%',
					) );
				?>
		</div>
		<?php echo $form->error($model,'description'); ?>
	</div>
	<?php echo $form->hiddenField($model,'links_num'); ?>
	<?php echo $form->error($model,'links_num'); ?>
	<?php echo $form->hiddenField($model,'order'); ?>
	<?php echo $form->error($model,'order'); ?>
	<div class="control-group">
		<?php echo $form->labelEx($model,'active',array('class'=>'control-label','for'=>'active')); ?>
		<div class="controls">
				
			<div class="btn-group" data-toggle="buttons-radio">
				<button onclick="document.getElementById('Server_active').value=1;return false;" class="btn btn-primary <?php if($model->active!='0'){echo 'active';}?>">True</button>
				<button onclick="document.getElementById('Server_active').value=0;return false;" class="btn btn-primary <?php if($model->active=='0'){echo 'active';}?>">False</button>
			</div>
			<?php echo $form->hiddenField($model,'active'); ?>
			<?php echo $form->error($model,'active'); ?>
		</div>
	</div>
	<div class="form-actions">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class'=>'btn btn-primary btn-large')); ?>
		<?php echo CHtml::link('Cancel',array('/server/admin','fid'=>$film->id),array('class'=>'btn btn-large')); ?>
	</div>
	</fieldset>
<?php $this->endWidget(); ?>

</div><!-- form -->
<script type="text/javascript">
	$('input#Server_name').val($('select#Server_en_name option:selected').text());
	$('input#Server_en_name').val($('select#Server_en_name').val());
	
	$('select#Server_en_name').change(function(){
		$('input#Server_name').val($(this).find('option:selected').text());
		$('input#Server_en_name').val($(this).val());
	});
</script>